<div class="nav">
    <a href="{:U('index')}">帮助中心栏目</a>
    <a href="{:U('add')}" class="sel">添加栏目</a>
</div>
<div class="add">
    <form method="post" action="" onsubmit="return checkform()" >
        <table class="table_add">
            <tr>
                <td width="100px">所属父级</td>
                <td><select name="parent_id" id="parent_id" class="sel1">
                        <option value="0">顶级类别</option>
                        <foreach name="parent_list" item="item">
                            <option value="{$item.help_id}" >{$item.help_name}</option>
                        </foreach>
                    </select>
                </td>
            </tr>
            <tr>
                <td width="100px">栏目名称</td>
                <td><input class="input1" type="text" name="help_name" id="help_name" value="" style="width:140px" /> </td>
            </tr>
            
                 <tr>
                <td>手机图标</td>
                <td>
                  <include file="Public/uploadfile" filetype="image" id="ico"  value="" editvalue="{}" width="100" path="help" limit="1" thumbw="" thumbh="" msg="100px*100px"/>
                </td>
            </tr>
            <tr>
                <td width="100px">栏目类别</td>
                <td><select name="type" id="type" class="sel1">
                        <option value="">选择类别</option>
                        <option value="类别">类别</option>
                        <option value="单页">单页</option>
                        <option value="链接">链接</option>
                        <option value="资讯">资讯</option>
                    </select> <label class="msg">*</td>
            </tr>
            <tr id="tr_link" style="display:none;">
                <td width="100px">菜单链接</td>
                <td><input class="input1" type="text" name="link" id="link" value="" style="width:400px" /> <label class="msg"></label></td>
            </tr>
            <tr class="tr_detail" style="display:none;">
                <td width="100px">详细介绍</td>
                <td>
                    <include file="Public/kindeditor" id="detail" value="" thumbw="12000" thumbh="12000"/>
            
               </td>
            </tr>
           <tr class="tr_seo" style="display:none;">
                <td width="100px">页面标题</td>
                <td><input class="input1" type="text" name="seo_title" id="seo_title" value="" style="width:500px" /></td>
            </tr>
            <tr class="tr_seo" style="display:none;">
                <td width="100px">页面关键词</td>
                <td><input class="input1" type="text" name="seo_keywords" id="seo_keywords" value="" style="width:500px" /></td>
            </tr>
           <tr class="tr_seo" style="display:none;">
                <td width="100px">页面描述</td>
                <td><textarea class="textarea1" name="seo_description" id="seo_description" style="width:500px;height:80px;"   ></textarea></td>
            </tr>
            <tr>
                <td width="100px">顺序编号</td>
                <td><input class="input1" type="text" name="order_id" id="order_id" value="1000" style="width:60px" /> <label class="msg">*</label></td>
            </tr>
            <tr>
                <td width="100px">是否显示</td>
                <td><select name="is_show" id="is_show" class="sel1">
                        <option value="1">显示</option>
                        <option value="0">不显示</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td></td>
                <td><input type="submit" class="btn1" value="提 交" /> &nbsp; <input class="btn4" type="reset" value="重 置" /> &nbsp; <input class="btn3"  type="button" onclick="window.history.back()" value="返 回" /></td>
            </tr>
        </table>
    </form>
</div>
<script type="text/javascript">
    $("#type").change(function() {
        var menu_type = $("#type").val();
        if (menu_type == '类别')
        {
            $("#tr_link").hide();
            $(".tr_detail").hide();
            $(".tr_seo").hide();;
        } else if ( menu_type == '单页') {
            $("#tr_link").hide();
            $(".tr_detail").show();;
            $(".tr_seo").show();;
        } else if ( menu_type == '链接') {
            $("#tr_link").show();
            $(".tr_detail").hide();
            $(".tr_seo").hide();;
        } else if ( menu_type == '资讯') {
             $("#tr_link").hide();
            $(".tr_detail").hide();
            $(".tr_seo").show();;
        }
    });
    
    function checkform() {
        var help_name = $.trim($("#help_name").val());
        var type = $.trim($("#type").val());
        if(help_name == '') {
            alert('请填写栏目名称！');
            $("#help_name").focus();
            return false;
        }
        if(type == '') {
            alert('请选择类型！');
            $("#type").focus();
            return false;
        }
    }
</script>
